/*    */ package bupt.luo.demo.controller;
/*    */ 
/*    */ import bupt.luo.demo.common.ApiResult;
/*    */ import bupt.luo.demo.entity.CityMonthQuantity;
/*    */ import bupt.luo.demo.entity.ProvinceMoney;
/*    */ import bupt.luo.demo.entity.ProvinceMonthMoney;
/*    */ import bupt.luo.demo.entity.ProvinceMonthQuantity;
/*    */ import bupt.luo.demo.entity.ProvinceQuantity;
/*    */ import bupt.luo.demo.service.SoldService;
/*    */ import bupt.luo.demo.util.ResultUtil;
/*    */ import java.util.List;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.web.bind.annotation.GetMapping;
/*    */ import org.springframework.web.bind.annotation.RequestParam;
/*    */ import org.springframework.web.bind.annotation.ResponseBody;
/*    */ 
/*    */ @Controller
/*    */ public class SoldController {
/*    */   @ResponseBody
/*    */   @GetMapping({"/get/province/quantity"})
/*    */   public ApiResult getProvinceQuantity(@RequestParam("countryName") String countryName) {
/* 23 */     List<ProvinceQuantity> provinceQuantities = this.soldService.getProvinceQuantity(countryName);
/* 24 */     if (provinceQuantities != null) {
/* 25 */       return ResultUtil.success(provinceQuantities, "get province's quantity successfully");
/*    */     }
/* 27 */     return ResultUtil.error(Integer.valueOf(-1), "get province's quantity failed");
/*    */   }
/*    */   
/*    */   @Autowired
/*    */   private SoldService soldService;
/*    */   
/*    */   @ResponseBody
/*    */   @GetMapping({"/get/province/money"})
/*    */   public ApiResult getProvinceMoney(@RequestParam("countryName") String countryName) {
/* 36 */     List<ProvinceMoney> provinceMoney = this.soldService.getProvinceMoney(countryName);
/* 37 */     if (provinceMoney != null) {
/* 38 */       return ResultUtil.success(provinceMoney, "get province's money successfully");
/*    */     }
/* 40 */     return ResultUtil.error(Integer.valueOf(-1), "get province's money failed");
/*    */   }
/*    */ 
/*    */   
/*    */   @ResponseBody
/*    */   @GetMapping({"/get/province/month/quantity"})
/*    */   public ApiResult getProvinceMonthQuantity(@RequestParam("provinceName") String provinceName) {
/* 47 */     List<ProvinceMonthQuantity> provinceMonthQuantity = this.soldService.getProvinceMonthQuantity(provinceName);
/* 48 */     if (provinceMonthQuantity != null) {
/* 49 */       return ResultUtil.success(provinceMonthQuantity, "get province's quantity every month successfully");
/*    */     }
/* 51 */     return ResultUtil.error(Integer.valueOf(-1), "get province's quantity every month failed");
/*    */   }
/*    */ 
/*    */   
/*    */   @ResponseBody
/*    */   @GetMapping({"/get/province/month/money"})
/*    */   public ApiResult getProvinceMonthMoney(@RequestParam("provinceName") String provinceName) {
/* 58 */     List<ProvinceMonthMoney> provinceMonthMoney = this.soldService.getProvinceMonthMoney(provinceName);
/* 59 */     if (provinceMonthMoney != null) {
/* 60 */       return ResultUtil.success(provinceMonthMoney, "get province's money every month successfully");
/*    */     }
/* 62 */     return ResultUtil.error(Integer.valueOf(-1), "get province's money every month failed");
/*    */   }
/*    */ 
/*    */   
/*    */   @ResponseBody
/*    */   @GetMapping({"/get/city/month/quantity"})
/*    */   public ApiResult getCityMonthQuantity(@RequestParam("provinceName") String provinceName, @RequestParam("month") int month) {
/* 69 */     List<CityMonthQuantity> cityMonthQuantity = this.soldService.getCityMonthQuantity(provinceName, month);
/* 70 */     if (cityMonthQuantity != null) {
/* 71 */       return ResultUtil.success(cityMonthQuantity, "get a province's city of quantity at a month successfully");
/*    */     }
/* 73 */     return ResultUtil.error(Integer.valueOf(-1), "get a province's city of quantity at a month failed");
/*    */   }
/*    */ }


/* Location:              C:\Users\28293\Desktop\demo-0.0.1-SNAPSHOT\BOOT-INF\classes.zip!\classes\bupt\luo\demo\controller\SoldController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */